#ifndef UTIL_H
#define UTIL_H

#include <QDebug>

typedef float f32;
typedef double f64;
typedef char i8;
typedef short i16;
typedef int i32;

// #define byte unsigned char
typedef unsigned char byte;
typedef byte u8;
typedef unsigned short u16;
typedef unsigned int u32;

#ifdef __x86_64__

typedef long long i64;
typedef unsigned long long u64;

typedef __int128 i128;

#else

#endif

template<class T>
void xp(T t)
{
    qDebug() << t;
}

template<class F>
void test_run_times(unsigned long n, F f)
{
    for (unsigned long i = 0; i < n; i++) {
        f();
    }
}

//[min,max);
int xNextRandom(int min, int max);

//[0,max)
int xNextRandom(int max);

template<class F>
void xlp(int i, int j, F f)
{
    for (; i < j; i++) {
        f(i);
    }
}

#endif // UTIL_H
